package com.bis.ymyy.service.impl;

import com.bis.ymyy.common.utils.AddUserInfo;
import com.bis.ymyy.entity.Doctor;
import com.bis.ymyy.mapper.DoctorMapper;
import com.bis.ymyy.service.DoctorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DoctorServiceImpl implements DoctorService {

    @Autowired
    DoctorMapper doctorMapper;
    @Override
    public List<Doctor> getAll() {
        return doctorMapper.getAll();
    }

    @Override
    public Doctor findById(int id) {
        return doctorMapper.findById(id);
    }

    @Override
    public int modifyById(Doctor doctor) {
        return doctorMapper.modifyById(doctor);
    }

    @Override
    public int deleteById(int id) {
        return doctorMapper.deleteById(id);
    }

    @Override
    public Doctor login(String userName, String password) {
        return doctorMapper.login(userName, password);
    }

    @Override
    public int addDoctor(String userName, String password) {
        return doctorMapper.addDoctor(userName, password);
    }

    @Override
    public int addBaseDoctor(AddUserInfo userInfo) {
        return doctorMapper.addBaseDoctor(userInfo);
    }

    @Override
    public Doctor findByUserName(String userName) {
        return doctorMapper.findByUserName(userName);
    }
}
